package com.lcq.study.javabase;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;

public class ThreadPoolTest {
    public static void main(String[] args) {
        CompletableFuture<Void> hello = CompletableFuture.runAsync(() -> {
            System.out.println("hello");
            int a = 10 / 0;
        });

        try {
            CompletableFuture.allOf(hello).get();
        } catch (InterruptedException e) {
            e.printStackTrace();
        } catch (ExecutionException e) {
            e.printStackTrace();
        }
    }
}
